{extend name='main'}

{block name="button"}
{if $type neq 'info'}
{if auth("add")}
<button data-open='{:url("add")}?type={$type}' data-title="添加{$type_name}" class='layui-btn layui-btn-sm layui-btn-primary' >添加{$type_name}</button>
{/if}
<!--style ="VISIBILITY: hidden"  隐藏属性-->
{if auth("remove")}
<button  data-action='{:url("remove")}' data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除{$type_name}</button>
{/if}
{/if}
{/block}
{block name="content"}
<div  class="think-box-shadow">
    {include file='singlepage/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            {if $type neq 'infolist'}<th style="width:10%">缩略图</th>{/if}
            <th class='layui-hide-xs' style="width:10%">标题</th>
            <th class='layui-hide-xs' style="width:10%">栏目名称</th>
            <th class='layui-hide-xs' style="width:10%">更新时间</th>
            <th class='layui-hide-xs' style="width:10%">发布人</th>
            <th class='layui-hide-xs' style="width:10%">点击</th>
            <th class='layui-hide-xs' style="width:10%">操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}


        <tr  data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='list-table-sort-td'>
                <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
            </td>
            {if $type neq 'infolist'}<td class="nowrap"><img src="{$vo.thumb}" height="40px;width:40px;" /></td>{/if}
            <td class="nowrap"><span class="color-desc"></span>{$vo.title}</td>
            <td class="nowrap" >{$category[$vo.category_id]}</td>
            <td class="nowrap">{$vo.update_at|format_datetime='Y-m-d H:i'}</td>
            <td class="nowrap">{$vo.create_by}</td>
            <td class="nowrap">{$vo.read_num}</td>
            <td  class='text-center nowrap notselect'>
                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑信息" data-open='{:url("edit")}?id={$vo.id}&type={$vo.type}&category_id={$vo.category_id}'>编 辑</a>
                {/if}
            </td>
        </tr>

        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}


